﻿//-----------------------------------------------------------------------
// <copyright file="IIdentityRepository.cs" company="FastNET Services">
//     Copyright (c) 2008-2009. All Rights Reserved.
// </copyright>
// <license>
//     GPLv2
// </license>
// <warranty>
//     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
//     BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
//     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
//     DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//     OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// </warranty>
//-----------------------------------------------------------------------
//Code can be found in the GateShift project too: http://gateshift.codeplex.com
#region Usings

using System;
using FastNET.CleanAct.Common.Repository.Interfaces.DataInterfaces.Base;

#endregion

namespace FastNET.CleanAct.Common.Repository.Interfaces.Repositories.Base
{
    /// <summary>
    /// Generic interface for all repositories
    /// </summary>
    /// <typeparam name="D">IIdentityData to base the operations off of</typeparam>
    public interface IIdentityRepository<D> : IRepository<D>
        where D : IIdentityData
    {
        /// <summary>
        /// Retrieves the requested <typeparamref name="D"/> by an Identity
        /// </summary>
        /// <param name="ID">Identity to retrieve the data by</param>
        /// <returns>IData instance or null if one was not found</returns>
        /// <exception cref="InvalidCastException">Thrown if the identity is of the wrong type for this datasource</exception>
        D Retrieve(Identity ID);
    }
}